package com.atguigu.eduservice.controller.web;

import com.atguigu.common.R;
import com.atguigu.eduservice.service.EduCourseService;
import com.atguigu.eduservice.service.TeacherService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @Author panghl
 * @Date 2021/1/31 15:54
 * @Description 前台接口
 **/
@RestController
@RequestMapping("/eduservice/web/")
@Api(tags = {"edu前台接口"})
public class IndexFrontController {

    @Autowired
    private EduCourseService eduCourseService;


    @ApiOperation("查询前8条热门课程，和前4条名师")
    @GetMapping("/index")
    public R index(){
        Map<String, Object> map = eduCourseService.buildIndexData();
        return R.ok().data(map);
    }

}
